//Copyright (c) 2006-2007 Microsoft Corporation.  All rights reserved
using System;

using InvocationFramework.Common.Library;

namespace InvocationFramework.Adapters.Inproc
{
    /// <summary>
    /// Helper para ejecutar una operacion
    /// </summary>
    /// <author>Rodolfo Finochietti 30/12/2005 11.51</author>
    internal static class OperationExecutor
    {
        #region Public Methods

        /// <summary>
        /// Ejecuta la operacion pasada por parametro
        /// </summary>
        /// <param name="operDef">Definicion de la operacion a ejecutar</param>
        /// <param name="parameters">Parametros</param>
        /// <returns>Resultado de la ejecucion</returns>
        public static object Execute( OperationDefinition operDef, params object[] parameters )
        {
            return ReflectionHelper.InvokeMember( operDef.OperationMethod, operDef.OperationType, parameters );
        }

        #endregion
    }
}